﻿using Easy.Services.Entities;
using System.Linq.Expressions;

namespace Easy.Services.Interface
{
    public interface IPermissionService
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="permission"></param>
        /// <returns></returns>
        Permission Add(Permission permission);

        /// <summary>
        /// 获取
        /// </summary>
        /// <param name="expression"></param>
        /// <returns></returns>
        Permission Get(Expression<Func<Permission, bool>> expression);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="permission"></param>
        /// <returns></returns>
        Permission Update(Permission permission);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="permission"></param>
        /// <returns></returns>
        bool Delete(Permission permission);

        /// <summary>
        /// 获取集合
        /// </summary>
        /// <param name="whereExpression">条件</param>
        /// <param name="includeDelete">是否包含软删除数据false不包含true包含软删除</param>
        /// <returns>返回结果</returns>
        List<Permission> GetList(Expression<Func<Permission, bool>> whereExpression = null, bool includeDelete = false);

        /// <summary>
        /// 存在
        /// </summary>
        /// <param name="expression"></param>
        /// <returns></returns>
        bool Exist(Expression<Func<Permission, bool>> expression);


    }

}
